Method and system for single pass volume scanning for multiple destination mirroring

ABSTRACT

A mirroring application running on a primary server in a multiple destination mirroring environment is provided. The mirroring application configures a scanner with snapshots that are registered. The scanner calculates a logical age for each snapshot. The scanner scans a flexible volume once for data blocks that are newer than a predetermined snapshot. The scanner tags each such block with a logical age that is equivalent to the oldest snapshot that refers to that block. The scanner loads the tagged blocks in a queue. A sender module associated with each destination in the mirroring environment inspects blocks in the queue and retrieves only those blocks younger than a destination reference snapshot. The sender sends those blocks to the destination and filters out older blocks, thus bringing the destination mirror up to date with the current active file system.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention relates to a distributed cluster computerenvironment and, more particularly, to multiple destination mirroring insuch an environment.

2. Background Information

A storage system typically comprises one or more storage devices intowhich information may be entered, and from which information may beobtained, as desired. The storage system includes a storage operatingsystem that functionally organizes the system by, inter alia, invokingstorage operations in support of a storage service implemented by thesystem. The storage system may be implemented in accordance with avariety of storage architectures including, but not limited to, anetwork-attached storage environment, a storage area network and a diskassembly directly attached to a client or host computer. The storagedevices are typically disk drives organized as a disk array, wherein theterm “disk” commonly describes a self-contained rotating magnetic mediastorage device. The term disk in this context is synonymous with harddisk drive (HDD) or direct access storage device (DASD).

The storage operating system of the storage system may implement ahigh-level module, such as a file system, to logically organize theinformation stored on volumes as a hierarchical structure of datacontainers, such as files and logical units. For example, each “on-disk”file may be implemented as set of data structures, i.e., disk blocks,configured to store information, such as the actual data for the file.These data blocks are organized within a volume block number (vbn) spacethat is maintained by the file system. The file system may also assigneach data block in the file a corresponding “file offset” or file blocknumber (fbn). The file system typically assigns sequences of fbns on aper-file basis, whereas vbns are assigned over a larger volume addressspace. The file system organizes the data blocks within the vbn space asa “logical volume”; each logical volume may be, although is notnecessarily, associated with its own file system.

A known type of file system is a write-anywhere file system that doesnot overwrite data on disks. If a data block is retrieved (read) fromdisk into a memory of the storage system and “dirtied” (i.e., updated ormodified) with new data, the data block is thereafter stored (written)to a new location on disk to optimize write performance. Awrite-anywhere file system may initially assume an optimal layout suchthat the data is substantially contiguously arranged on disks. Theoptimal disk layout results in efficient access operations, particularlyfor sequential read operations, directed to the disks. An example of awrite-anywhere file system that is configured to operate on a storagesystem is the Write Anywhere File Layout (WAFL™) file system availablefrom Network Appliance, Inc., Sunnyvale, Calif.

The storage system may be further configured to operate according to aclient/server model of information delivery to thereby allow manyclients to access data containers stored on the system. In this model,the client may comprise an application, such as a database application,executing on a computer that “connects” to the storage system over acomputer network, such as a point-to-point link, shared local areanetwork (LAN), wide area network (WAN), or virtual private network (VPN)implemented over a public network such as the Internet. Each client mayrequest the services of the storage system by issuing file-based andblock-based protocol messages (in the form of packets) to the systemover the network.

A plurality of storage systems may be interconnected to provide astorage system environment configured to service many clients. Eachstorage system may be configured to service one or more volumes, whereineach volume stores one or more data containers. Yet often a large numberof data access requests issued by the clients may be directed to a smallnumber of data containers serviced by a particular storage system of theenvironment. A solution to such a problem is to distribute the volumesserviced by the particular storage system among all of the storagesystems of the environment. This, in turn, distributes the data accessrequests, along with the processing resources needed to service suchrequests, among all of the storage systems, thereby reducing theindividual processing load on each storage system.

In order to improve reliability and to facilitate disaster recover inthe event of a failure in a distributed system, it is common to“mirror,” i.e., replicate, some or all of the underlying data and/or thefile system that organizes that data from a source volume associatedwith a primary storage system or server to one or more remote storagedestinations. To that end, a mirror of the source volume is establishedand stored as a destination volume at a remote site, making it morelikely that recovery is possible in a disaster that may physicallydamage the main storage location or infrastructure (e.g. floods, poweroutage, act of war, etc.). The mirror is updated at regular intervals,typically by an administrator in an effort to reproduce the most recentchanges to the volume.

The inherent Snapshot™ capabilities of the exemplary WAFL file systemare further described in TR3002 File System Design for an NFS FileServer Appliance by David Hitz et al., published by Network Appliance,Inc., which is hereby incorporated by reference as though fully setforth herein. Further details are provided in commonly owned U.S. patentapplication Ser. No. 10/100,967, entitled SYSTEM AND METHOD FORDETERMINING CHANGES IN TWO SNAPSHOTS AND FOR TRANSMITTING CHANGES TO ADESTINATION SNAPSHOT, filed on Mar. 19, 2002, which is herebyincorporated by reference as though fully set forth herein.

It is noted that “Snapshot” is a trademark of Network Appliance, Inc. Itis used for purposes of this patent to designate a persistentconsistency point (CP) image. A persistent consistency point image(PCPI) is a point-in-time representation of the storage system, and moreparticularly, of the active file system, stored on a storage device(e.g., on disk) or in other persistent memory and having a name or otherunique identifier that distinguishes it from other PCPIs taken at otherpoints in time. A PCPI can also include other information (metadata)about the active file system at the particular point in time for whichthe image is taken. The terms “PCPI” and “snapshot” shall be usedinterchangeably through out this patent without derogation of NetworkAppliance's trademark rights.

Snapshots are generally created on some regular schedule. This scheduleis subject to great variation. In addition, the number of snapshotsretained by the filer is highly variable. Under one storage scheme, anumber of recent snapshots are stored in succession (for example, a fewdays worth of snapshots each taken at four-hour intervals), and a numberof older snapshots are retained at increasing time spacings (forexample, a number of daily snapshots for the previous week(s) and weeklysnapshot for the previous few months). The snapshot is stored on-diskalong with the active file system, and is called into the buffer cacheof the filer memory as requested by the storage operating system orother application. However, it is contemplated that a variety ofsnapshot creation techniques and timing schemes can be implementedwithin the teachings of this invention.

One form of snapshot process includes the active file system (e.g.,inodes and data blocks) at the primary server being captured andtransmitted as a whole over a network (such as the Internet) to a remotestorage destination site. Generally, a snapshot is an image, typicallyread-only, which is a replication of a volume at a point in time. Thereplicated image is initially stored on one or more storage devices onthe primary server. After the snapshot is created and stored, the activefile system is reestablished leaving the snapshot version in place forpossible future restoration of the file system at previous points intime. The snapshot process is described in further detail in U.S. patentapplication Ser. No. 09/932,578, entitled INSTANT SNAPSHOT, by BlakeLewis et al., which is hereby incorporated by reference as though fullyset forth herein, and in U.S. patent application Ser. No. 10/100,434entitled SYSTEM AND METHOD FOR REDIRECTING ACCESS TO A REMOTE MIRROREDSNAPSHOT, by Raymond C. Chen et al., which is hereby incorporated byreference as though fully set forth herein.

As noted, it is often necessary to update the mirrored system when theactive file system on the primary server experiences changes. Typically,a new snapshot of the entire file system is periodically generated andtransmitted to each destination. However, it is desirable to transmitincrementally the changes to the file system, instead of the entire filesystem. In order to update incrementally each snapshot with currentchanges, the source volume is typically scanned at least one time foreach destination that is mirrored in order to find the updates whichhave not yet been transmitted to that particular destination. Thisinvolves multiple scans of the source volume, which consume time andbandwidth of the volume and the server, and further requires keepingtrack of which version of the file system exists on each destination.Some systems, however, do not provide version support with respect toeach data block of the file system and, therefore, it is difficult todetermine which snapshot exists on each destination volume in thesystem.

Thus, there remains a need for a method and system for mirroring asource volume to multiple destinations which reduces the amount of scansperformed on the volume while maintaining accurate information aboutwhich snapshot exists on the destination prior to attempted replication.

SUMMARY OF THE INVENTION

The present invention overcomes the disadvantages of the prior art byproviding a technique for multiple destination mirroring in adistributed storage system environment comprising two or more volumesdistributed across a plurality of nodes interconnected as a cluster.According to the invention, a mirroring application is configured toefficiently manage multiple destination mirroring of one or moreflexible volumes which are replicas of the file system at a node, i.e.,a primary server, which acts as a mirror source. In accordance with theinvention, when a mirroring session is to commence, a snapshot isgenerated to provide an image of the active file system, to bedistributed to the mirror destinations.

In accordance with an illustrative embodiment of the invention, amirroring application running on the primary server configures a scannerwhich is a software object, which is executed by a thread in the storageoperating system environment. The mirroring application furtherconfigures one or more sender modules (“senders”), each of which isassociated with a destination in the mirroring environment. To initiatethe replication, each sender queries its destination to request itsreference snapshot. The sender, having thus been notified of thereference snapshot of the destination, registers the snapshot with thescanner. The scanner determines the oldest snapshot for the group ofdestinations in the mirror process and the scanner then calculates alogical age for each snapshot with the most recent snapshot beingassigned an age equal to 1, and with progressively older snapshots beingassigned 2, 3, etc. The scanner is further configured to scan the volumeto be mirrored to the destinations for blocks that are newer than theoldest reference snapshot in the group. The scanner then tags each suchblock with a logical age that is equivalent to the oldest snapshot thatrefers to that block, and places the tagged blocks in a queue.

The sender module then inspects blocks in the queue and “filters”(discards) data blocks that are older than its reference snapshotbecause its destination already has those data blocks from priorreplication processes. The sender retrieves those blocks that areyounger than the destination reference snapshot. The sender then sendsthose blocks with an age more recent than the destination's referencesnapshot to the destination. Thus, the destination is brought up to datewith the current active file system without resending the entirecontents of the file system snapshot. Techniques for baseline mirroringfor a new destination are also described herein. Advantageously, thenovel technique requires only one pass of the scanner through a flexiblevolume and does not require the scanner to repeatedly scan the volumefor each destination to be updated.

BRIEF DESCRIPTION OF THE DRAWINGS

The above and further advantages of the present invention may be betterunderstood by referring to the following description in conjunction withthe accompanying drawings in which like reference numerals indicateidentical or functionally similar elements:

FIG. 1 is a schematic block diagram of a plurality of nodesinterconnected as a cluster in accordance with an illustrativeembodiment of the present invention;

FIG. 2 is a schematic block diagram of a node in accordance with anillustrative embodiment of the present invention;

FIG. 3 is a schematic block diagram of a storage operating system thatmay be advantageously employed with an illustrative embodiment of thepresent invention;

FIG. 4 is a schematic block diagram illustrating the format of a clusterfabric (CF) message in accordance with an illustrative embodiment of thepresent invention;

FIG. 5 is a schematic block diagram of the format of a data containerhandle in accordance with an illustrative embodiment of the presentinvention;

FIG. 6 is a schematic block diagram of an exemplary inode in accordancewith an illustrative embodiment of the present invention;

FIG. 7 is a schematic block diagram of an exemplary buffer tree inaccordance with an illustrative embodiment of the present invention;

FIG. 8 is a schematic block diagram of an illustrative embodiment of abuffer tree of a file that may be advantageously used with the presentinvention;

FIG. 9 is a schematic block diagram of an aggregate in accordance withan illustrative embodiment of the present invention;

FIG. 10 is a schematic block diagram of an exemplary on-disk layout ofthe aggregate in accordance with an embodiment of the present invention;

FIGS. 11A-11C illustrate a simplified version of a flexible volume in anillustrative mirroring environment in which the techniques of thepresent invention can be advantageously employed;

FIGS. 11D and 11E illustrate replication of the volume of FIGS. 11A-11Cbeing mirrored to a remote destination;

FIG. 12 is a schematic illustration of a replication of a volume beingmirrored to a remote location subsequent to the replication process ofFIGS. 11D and 11E;

FIG. 13 is a schematic block diagram of a multiple destination mirroringenvironment in accordance with an illustrative embodiment of the presentinvention;

FIG. 14 is a flowchart illustrating a procedure for initialconfiguration of the multiple destination mirroring environmentillustrated in FIG. 13; and

FIG. 15 is a flowchart illustrating a procedure for replication ofupdated data to each destination in the multiple destination mirrorenvironment of the present invention.

DETAILED DESCRIPTION OF AN ILLUSTRATIVE EMBODIMENT

A. Cluster Environment

FIG. 1 is a schematic block diagram of a plurality of nodes 200interconnected as a cluster 100 and configured to provide storageservice relating to the organization of information on storage devices.The nodes 200 comprise various functional components that cooperate toprovide a distributed storage system architecture of the cluster 100. Tothat end, each node 200 is generally organized as a network element(N-module 310) and a disk element (D-module 350). The N-module 310includes functionality that enables the node 200 to connect to clients180 over a computer network 140, while each D-module 350 connects to oneor more storage devices, such as disks 130 of a disk array 120. Thenodes 200 are interconnected by a cluster switching fabric 150 which, inthe illustrative embodiment, may be embodied as a Gigabit Ethernetswitch. The exemplary distributed file system architecture is generallydescribed in U.S. Patent Application Publication No. US 2002/0116593entitled METHOD AND SYSTEM FOR RESPONDING TO FILE SYSTEM REQUESTS, by M.Kazar et al. published Aug. 22, 2002.

It should be noted that while there is shown an equal number of N andD-modules in the illustrative cluster 100, there may be differingnumbers of N and/or D-modules in accordance with various embodiments ofthe present invention. For example, there may be a plurality ofN-modules and/or D-modules interconnected in a cluster configuration 100that does not reflect a one-to-one correspondence between the N andD-modules. As such, the description of a node 200 comprising oneN-module and one D-module should be taken as illustrative only. In analternate embodiment, each N or D-module in a distributed storage systemenvironment may be referred to as a node of such environment.

The clients 180 may be general-purpose computers configured to interactwith the node 200 in accordance with a client/server model ofinformation delivery. That is, each client may request the services ofthe node, and the node may return the results of the services requestedby the client, by exchanging packets over the network 140. The clientmay issue packets including file-based access protocols, such as theCommon Internet File System (CIFS) protocol or Network File System (NFS)protocol, over the Transmission Control Protocol/Internet Protocol(TCP/IP) when accessing information in the form of files anddirectories. Alternatively, the client may issue packets includingblock-based access protocols, such as the Small Computer SystemsInterface (SCSI) protocol encapsulated over TCP/IP (iSCSI) and SCSIencapsulated over Fibre Channel (FCP), when accessing information in theform of blocks.

B. Storage System Node

FIG. 2 is a schematic block diagram of an exemplary node 200 that isillustratively embodied as a storage system comprising a plurality ofprocessors 222 a,b, a memory 224, a network adapter 225, a clusteraccess adapter 226, a storage adapter 228 and local storage 230interconnected by a system bus 223. The local storage 230 comprises oneor more storage devices, such as disks, utilized by the node to locallystore configuration information (e.g., in configuration table 235). Thecluster access adapter 226 comprises a plurality of ports adapted tocouple the node 200 to other nodes of the cluster 100. In theillustrative embodiment, Ethernet is used as the clustering protocol andinterconnect media, although it will be apparent to those skilled in theart that other types of protocols and interconnects may be utilizedwithin the cluster architecture described herein. In alternateembodiments where the N-modules and D-modules are implemented onseparate storage systems or computers, the cluster access adapter 226 isutilized by the N/D-module for communicating with other N/D-modules inthe cluster 100.

Each node 200 is illustratively embodied as a dual processor storagesystem executing a storage operating system 300 that preferablyimplements a high-level module, such as a file system, to logicallyorganize the information as a hierarchical structure of named datacontainers, such as directories, files and special types of files calledvirtual disks (hereinafter generally “blocks”) on the disks. However, itwill be apparent to those of ordinary skill in the art that the node 200may alternatively comprise a single or more than two processor system.Illustratively, one processor 222 a executes the functions of theN-module 310 on the node, while the other processor 222 b executes thefunctions of the D-module 350.

The memory 224 illustratively comprises storage locations that areaddressable by the processors and adapters for storing software programcode and data structures associated with the present invention. Theprocessor and adapters may, in turn, comprise processing elements and/orlogic circuitry configured to execute the software code and manipulatethe data structures. The storage operating system 300, portions of whichis typically resident in memory and executed by the processing elements,functionally organizes the node 200 by, inter alia, invoking storageoperations in support of the storage service implemented by the node. Itwill be apparent to those skilled in the art that other processing andmemory means, including various computer readable media, may be used forstoring and executing program instructions pertaining to the inventiondescribed herein.

The network adapter 225 comprises a plurality of ports adapted to couplethe node 200 to one or more clients 180 over point-to-point links, widearea networks, virtual private networks implemented over a publicnetwork (Internet) or a shared local area network. The network adapter225 thus may comprise the mechanical, electrical and signaling circuitryneeded to connect the node to the network. Illustratively, the computernetwork 140 may be embodied as an Ethernet network or a Fibre Channel(FC) network. Each client 180 may communicate with the node over network140 by exchanging discrete frames or packets of data according topre-defined protocols, such as TCP/IP.

The storage adapter 228 cooperates with the storage operating system 300executing on the node 200 to access information requested by theclients. The information may be stored on any type of attached array ofwritable storage device media such as video tape, optical, DVD, magnetictape, bubble memory, electronic random access memory, micro-electromechanical and any other similar media adapted to store information,including data and parity information. However, as illustrativelydescribed herein, the information is preferably stored on the disks 130of array 120. The storage adapter comprises a plurality of ports havinginput/output (I/O) interface circuitry that couples to the disks over anI/O interconnect arrangement, such as a conventional high-performance,FC link topology.

Storage of information on each array 120 is preferably implemented asone or more storage “volumes” that comprise a collection of physicalstorage disks 130 cooperating to define an overall logical arrangementof volume block number (vbn) space on the volume(s). Each logical volumeis generally, although not necessarily, associated with its own filesystem. The disks within a logical volume/file system are typicallyorganized as one or more groups, wherein each group may be operated as aRedundant Array of Independent (or Inexpensive) Disks (RAID). Most RAIDimplementations, such as a RAID-4 level implementation, enhance thereliability/integrity of data storage through the redundant writing ofdata “stripes” across a given number of physical disks in the RAIDgroup, and the appropriate storing of parity information with respect tothe striped data. An illustrative example of a RAID implementation is aRAID-4 level implementation, although it should be understood that othertypes and levels of RAID implementations may be used in accordance withthe inventive principles described herein.

C. Storage Operating System

To facilitate access to the disks 130, the storage operating system 300implements a write-anywhere file system that cooperates with one or morevirtualization modules to “virtualize” the storage space provided bydisks 130. The file system logically organizes the information as ahierarchical structure of named directories and files on the disks. Each“on-disk” file may be implemented as set of disk blocks configured tostore information, such as data, whereas the directory may beimplemented as a specially formatted file in which names and links toother files and directories are stored. The virtualization module(s)allow the file system to further logically organize information as ahierarchical structure of blocks on the disks that are exported as namedlogical unit numbers (luns).

In the illustrative embodiment, the storage operating system ispreferably the NetApp® Data ONTAP® operating system available fromNetwork Appliance, Inc., of Sunnyvale, Calif. that implements a WriteAnywhere File Layout (WAFL®) file system. However, it is expresslycontemplated that any appropriate storage operating system may beenhanced for use in accordance with the inventive principles describedherein. As such, where the term “ONTAP®” is employed, it should be takenbroadly to refer to any storage operating system that is otherwiseadaptable to the teachings of this invention.

FIG. 3 is a schematic block diagram of the storage operating system 300that may be advantageously used with the present invention. The storageoperating system comprises a series of software layers organized to forman integrated network protocol stack or, more generally, amulti-protocol engine 325 that provides data paths for clients to accessinformation stored on the node using block and file access protocols.The multi-protocol engine includes a media access layer 312 of networkdrivers (e.g., gigabit Ethernet drivers) that interfaces to networkprotocol layers, such as the IP layer 314 and its supporting transportmechanisms, the TCP layer 316 and the User Datagram Protocol (UDP) layer315. A file system protocol layer provides multi-protocol file accessand, to that end, includes support for the Direct Access File System(DAFS) protocol 318, the NFS protocol 320, the CIFS protocol 322 and theHypertext Transfer Protocol (HTTP) protocol 324. A VI layer 326implements the VI architecture to provide direct access transport (DAT)capabilities, such as RDMA, as required by the DAFS protocol 318. AniSCSI driver layer 328 provides block protocol access over the TCP/IPnetwork protocol layers, while a FC driver layer 330 receives andtransmits block access requests and responses to and from the node. TheFC and iSCSI drivers provide FC-specific and iSCSI-specific accesscontrol to the blocks and, thus, manage exports of luns to either iSCSIor FCP or, alternatively, to both iSCSI and FCP when accessing theblocks on the node 200.

In addition, the storage operating system includes a series of softwarelayers organized to form a storage server 365 that provides data pathsfor accessing information stored on the disks 130 of the node 200. Tothat end, the storage server 365 includes a file system module 360 incooperating relation with a volume striping module (VSM) 370, a RAIDsystem module 380 and a disk driver system module 390. The RAID system380 manages the storage and retrieval of information to and from thevolumes/disks in accordance with I/O operations, while the disk driversystem 390 implements a disk access protocol such as, e.g., the SCSIprotocol. The VSM 370 illustratively implements a striped volume set(SVS). As described further herein, the VSM cooperates with the filesystem 360 to enable storage server 365 to service a volume of the SVS.In particular, the VSM 370 implements a Locate( ) function 375 tocompute the location of data container content in the SVS volume tothereby ensure consistency of such content served by the cluster.

The file system 360 implements a virtualization system of the storageoperating system 300 through the interaction with one or morevirtualization modules illustratively embodied as, e.g., a virtual disk(vdisk) module (not shown) and a SCSI target module 335. The vdiskmodule enables access by administrative interfaces, such as a userinterface of a management framework (not shown), in response to a user(system administrator) issuing commands to the node 200. The SCSI targetmodule 335 is generally disposed between the FC and iSCSI drivers 328,330 and the file system 360 to provide a translation layer of thevirtualization system between the block (lun) space and the file systemspace, where luns are represented as blocks.

The file system 360 is illustratively a message-based system thatprovides logical volume management capabilities for use in access to theinformation stored on the storage devices, such as disks. That is, inaddition to providing file system semantics, the file system 360provides functions normally associated with a volume manager. Thesefunctions include (i) aggregation of the disks, (ii) aggregation ofstorage bandwidth of the disks, and (iii) reliability guarantees, suchas mirroring as discussed herein, and/or parity (RAID). The file system360 illustratively implements the WAFL file system (hereinaftergenerally the “write-anywhere file system”) having an on-disk formatrepresentation that is block-based using, e.g., 4 kilobyte (KB) blocksand using index nodes (“inodes”) to identify files and file attributes(such as creation time, access permissions, size and block location).The file system uses files to store meta-data describing the layout ofits file system; these meta-data files include, among others, an inodefile. A file handle, i.e., an identifier that includes an inode number,is used to retrieve an inode from disk.

Broadly stated, all inodes of the write-anywhere file system areorganized into the inode file. A file system (fs) info block specifiesthe layout of information in the file system and includes an inode of afile that includes all other inodes of the file system. Each logicalvolume (file system) has an fsinfo block that is preferably stored at afixed location within, e.g., a RAID group. The inode of the inode filemay directly reference (point to) data blocks of the inode file or mayreference indirect blocks of the inode file that, in turn, referencedata blocks of the inode file. Within each data block of the inode fileare embedded inodes, each of which may reference indirect blocks that,in turn, reference data blocks of a file.

As described further herein, the file system 360 further includes asnapshot manager 362 that is configured to efficiently perform asnapshot process in which a snapshot of the active file system (e.g.,inodes and blocks), at the storage system (primary server) is capturedand stored in a snapshot storage area 364. By “active file system” it ismeant the file system to which current I/O operations are beingdirected. Once a snapshot is obtained, the active file system isreestablished leaving the snapshot in place for possible futurerestoration. As used herein, a snapshot is an image (typicallyread-only) of the entire file system as it existed when the shapshot istaken. The snapshot is stored on the same primary server as is theactive file system and is accessible by users of the active file system.The snapshot is also mirrored to mirror destinations in the multipledestination mirror environment.

The snapshots are also stored in the snapshot storage area 364. Notably,in the illustrative write-anywhere environment, when a block is to beedited, instead of editing that original block, a new block is created.Thus as snapshots are taken, the newly created blocks are captured inthe new snapshots. Each block or file is said to be “owned” by asnapshot, and in particular, in the illustrative example, each block isowned by the first snapshot in which it appeared, i.e., the oldestsnapshot that contains that block or file.

The file system 360 also contains a mirroring application 366, thedetails of which are described further herein. The mirroring applicationcontains various components which cooperate with the snapshot manager362 to send a snapshot to each mirror destination and to thereafterupdate each destination incrementally with newly created blocks have yetto be received by the particular destination by way of, e.g.,replication. This process is described in further detail hereinafter.

It should be noted that the software “path” through the storageoperating system layers described above needed to perform data storageaccess for the client request received at the node may alternatively beimplemented in hardware. That is, in an alternate embodiment of theinvention, a storage access request data path may be implemented aslogic circuitry embodied within a field programmable gate array (FPGA)or an application specific integrated circuit (ASIC). This type ofhardware implementation increases the performance of the storage serviceprovided by node 200 in response to a request issued by client 180.Moreover, in another alternate embodiment of the invention, theprocessing elements of adapters 225, 228 may be configured to offloadsome or all of the packet processing and storage access operations,respectively, from processor 222, to thereby increase the performance ofthe storage service provided by the node. It is expressly contemplatedthat the various processes, architectures and procedures describedherein can be implemented in hardware, firmware or software.

As used herein, the term “storage operating system” generally refers tothe computer-executable code operable on a computer to perform a storagefunction that manages data access and may, in the case of a node 200,implement data access semantics of a general purpose operating system.The storage operating system can also be implemented as a microkernel,an application program operating over a general-purpose operatingsystem, such as UNIX® or Windows XP®, or as a general-purpose operatingsystem with configurable functionality, which is configured for storageapplications as described herein.

In addition, it will be understood to those skilled in the art that theinvention described herein may apply to any type of special-purpose(e.g., file server, filer or storage serving appliance) orgeneral-purpose computer, including a standalone computer or portionthereof, embodied as or including a storage system. Moreover, theteachings of this invention can be adapted to a variety of storagesystem architectures including, but not limited to, a network-attachedstorage environment, and a storage area network and disk assemblydirectly-attached to a client or host computer. The term “storagesystem” should therefore be taken broadly to include such arrangementsin addition to any subsystems configured to perform a storage functionand associated with other equipment or systems. It should be noted thatwhile this description is written in terms of a write any where filesystem, the teachings of the present invention may be utilized with anysuitable file system, including a write in place file system.

D. CF Protocol

In the illustrative embodiment, the storage server 365 is embodied asD-module 350 of the storage operating system 300 to service one or morevolumes of array 120. In addition, the multi-protocol engine 325 isembodied as N-module 310 to (i) perform protocol termination withrespect to a client issuing incoming data access request packets overthe network 140, as well as (ii) redirect those data access requests toany storage server 365 of the cluster 100. Moreover, the N-module 310and D-module 350 cooperate to provide a highly-scalable, distributedstorage system architecture of the cluster 100. To that end, each moduleincludes a cluster fabric (CF) interface module 340 a,b adapted toimplement intra-cluster communication among the modules, as well asD-module-to-D-module communications, for data container stripingoperations, for example.

The protocol layers, e.g., the NFS/CIFS layers and the iSCSI/FC layers,of the N-module 310 function as protocol servers that translatefile-based and block based data access requests from clients into CFprotocol messages used for communication with the D-module 350. That is,the N-module servers convert the incoming data access requests into filesystem primitive operations (commands) that are embedded within CFmessages by the CF interface module 340 for transmission to theD-modules 350 of the cluster 100. Notably, the CF interface modules 340cooperate to provide a single file system image across all D-modules 350in the cluster 100. Thus, any network port of an N-module that receivesa client request can access any data container within the single filesystem image located on any D-module 350 of the cluster.

Further to the illustrative embodiment, the N-module 310 and D-module350 are implemented as separately-scheduled processes of storageoperating system 300; however, in an alternate embodiment, the modulesmay be implemented as pieces of code within a single operating systemprocess. Communication between an N-module and D-module is thusillustratively effected through the use of message passing between theN-module and D-module although, in the case of remote communicationbetween an N-module and D-module of different nodes, such messagepassing occurs over the cluster switching fabric 150. A knownmessage-passing mechanism provided by the storage operating system totransfer information between N-modules and D-modules (processes) is theInter Process Communication (IPC) mechanism. The protocol used with theIPC mechanism is illustratively a generic file and/or block-based“agnostic” CF protocol that comprises a collection of methods/functionsconstituting a CF application programming interface (API). Examples ofsuch an agnostic protocol are the SpinFS and SpinNP protocols availablefrom Network Appliance, Inc. The SpinFS protocol is described in theabove-referenced U.S. Patent Application Publication No. US2002/0116593.

The CF interface module 340 implements the CF protocol for communicatingfile system command messages, including novel mirroring command messagesdescribed herein, among the modules of cluster 100. For example, themirroring application communicates with the snapshot manager using theCF protocol. Additionally, the mirroring application 366 running on theprimary server configures one or more sender modules (“senders”) whichcommunicate with remote D-modules using the CF protocol.

Communication is illustratively effected by the D-module exposing the CFAPI to which an N-module (or another D-module) issues calls. To thatend, the CF interface module 340 is organized as a CF encoder and CFdecoder. The CF encoder of, e.g., CF interface 340 a on N-module 310encapsulates a CF message as (i) a local procedure call (LPC) whencommunicating a file system command to a D-module 350 residing on thesame node 200 or (ii) a remote procedure call (RPC) when communicatingthe command to a D-module residing on a remote node of the cluster 100.In either case, the CF decoder of CF interface 340 b on D-module 350de-encapsulates the CF message and processes the file system command.

FIG. 4 is a schematic block diagram illustrating the format of a CFmessage 400 in accordance with an embodiment of with the presentinvention. The CF message 400 is illustratively used for RPCcommunication over the switching fabric 150 between remote modules ofthe cluster 100; however, it should be understood that the term “CFmessage” may be used generally to refer to LPC and RPC communicationbetween modules of the cluster. The CF message 400 includes a mediaaccess layer 402, an IP layer 404, a UDP layer 406, a reliableconnection (RC) layer 408 and a CF protocol layer 410. As noted, the CFprotocol is a generic file system protocol that conveys file systemcommands related to operations contained within client requests toaccess data containers stored on the cluster 100; the CF protocol layer410 is that portion of message 400 that carries the file systemcommands, including the mirroring commands. Illustratively, the CFprotocol is datagram based and, as such, involves transmission ofmessages or “envelopes” in a reliable manner from a source (e.g., anN-module 310) to a destination (e.g., a D-module 350). The RC layer 408implements a reliable transport protocol that is adapted to process suchenvelopes in accordance with a connectionless protocol, such as UDP 406.

A data container, e.g., a file, is accessed in the file system using adata container handle. FIG. 5 is a schematic block diagram illustratingthe format of a data container handle 500 including a SVS ID field 502,an inode number field 504, a unique-ifier field 506, a striped flagfield 508 and a striping epoch number field 510. The SVS ID field 502contains a global identifier (within the cluster 100) of the SVS withinwhich the data container resides. The inode number field 504 contains aninode number of an inode (within an inode file) pertaining to the datacontainer. The unique-ifier field 506 contains a monotonicallyincreasing number that uniquely identifies the data container handle500. The unique-ifier is particularly useful in the case where an inodenumber has been deleted, reused and reassigned to a new data container.The unique-ifier distinguishes that reused inode number in a particulardata container from a potentially previous use of those fields. Thestriped flag field 508 is illustratively a Boolean value that identifieswhether the data container is striped or not. The striping epoch numberfield 510 indicates the appropriate striping technique for use with thisdata container for embodiments where the SVS utilizes differing stripingtechniques for different data containers. Further details about anillustrative file system organization can be found in commonly-ownedU.S. patent application Ser. No. 11/119,278, filed on Apr. 29, 2005, ofKazar, et al., for a STORAGE SYSTEM ARCHITECTURE FOR STRIPING DATACONTAINER CONTENT ACROSS VOLUMES OF A CLUSTER, which is incorporated byreference herein in its entirety.

E. File System Organization

In the illustrative embodiment, a data container is represented in thewrite-anywhere file system as an inode data structure adapted forstorage on the disks 130. FIG. 6 is a schematic block diagram of aninode 600, which preferably includes a meta-data section 605 and a datasection 660. The information stored in the meta-data section 605 of eachinode 600 describes the data container (e.g., a file) and, as such,includes the type (e.g., regular, directory, vdisk) 610 of file, itssize 615, time stamps (e.g., access and/or modification time) 620 andownership, i.e., user identifier (UID 625) and group ID (GID 630), ofthe file. The meta-data section 605 also includes a generation number631, and a meta-data invalidation flag field 634. The contents of thedata section 660 of each inode may be interpreted differently dependingupon the type of file (inode) defined within the type field 610. Forexample, the data section 660 of a directory inode contains meta-datacontrolled by the file system, whereas the data section of a regularinode contains file system data. In this latter case, the data section660 includes a representation of the data associated with the file.

Specifically, the data section 660 of a regular on-disk inode mayinclude file system data or pointers, the latter referencing 4 kB datablocks on disk used to store the file system data. Each pointer ispreferably a logical vbn to facilitate efficiency among the file systemand the RAID system 380 when accessing the data on disks. Given therestricted size (e.g., 128 bytes) of the inode, file system data havinga size that is less than or equal to 64 bytes is represented, in itsentirety, within the data section of that inode. However, if the lengthof the contents of the data container exceeds 64 bytes but less than orequal to 64 kB, then the data section of the inode (e.g., a first levelinode) comprises up to 16 pointers, each of which references a 4 kBblock of data on the disk.

Moreover, if the size of the data is greater than 64 kB but less than orequal to 64 megabytes (MB), then each pointer in the data section 660 ofthe inode (e.g., a second level inode) references an indirect block(e.g., a first level L1 block) that contains 1024 pointers, each ofwhich references a 4 kB data block on disk. For file system data havinga size greater than 64 MB, each pointer in the data section 660 of theinode (e.g., a third level L3 inode) references a double-indirect block(e.g., a second level L2 block) that contains 1024 pointers, eachreferencing an indirect (e.g., a first level L1) block. The in-directblock, in turn, that contains 1024 pointers, each of which references a4 kB data block on disk. When accessing a file, each block of the filemay be loaded from disk 130 into the memory 224.

When an on-disk inode (or block) is loaded from disk 130 into memory224, its corresponding in-core structure embeds the on-disk structure.For example, the dotted line surrounding the inode 600 indicates thein-core representation of the on-disk inode structure. The in-corestructure is a block of memory that stores the on-disk structure plusadditional information needed to manage data in the memory (but not ondisk). The additional information may include, e.g., a “dirty” bit 670.After data in the inode (or block) is updated/modified as instructed by,e.g., a write operation, the modified data is marked “dirty” using thedirty bit 670 so that the inode (block) can be subsequently “flushed”(stored) to disk. The in-core and on-disk format structures of the WAFLfile system, including the inodes and inode file, are disclosed anddescribed in the previously incorporated U.S. Pat. No. 5,819,292 titledMETHOD FOR MAINTAINING CONSISTENT STATES OF A FILE SYSTEM AND FORCREATING USER-ACCESSIBLE READ-ONLY COPIES OF A FILE SYSTEM by David Hitzet al., issued on Oct. 6, 1998.

FIG. 7 is a schematic block diagram of an embodiment of a buffer tree ofa file that may be advantageously used with the present invention. Thebuffer tree is an internal representation of blocks for a file (e.g.,file 700) loaded into the memory 224 and maintained by thewrite-anywhere file system 360. A root (top-level) inode 702, such as anembedded inode, references indirect (e.g., level 1) blocks 704. Notethat there may be additional levels of indirect blocks (e.g., level 2,level 3) depending upon the size of the file. The indirect blocks (andinode) contain pointers 705 that ultimately reference data blocks 706used to store the actual data of the file. That is, the data of file 700are contained in data blocks and the locations of these blocks arestored in the indirect blocks of the file. Each level 1 indirect block704 may contain pointers to as many as 1024 data blocks. According tothe “write anywhere” nature of the file system, these blocks may belocated anywhere on the disks 130.

A file system layout is provided that apportions an underlying physicalvolume into one or more virtual volumes (or flexible volume) of astorage system, such as node 200. An example of such a file systemlayout is described in U.S. patent application Ser. No. 10/836,817titled EXTENSION OF WRITE ANYWHERE FILE SYSTEM LAYOUT, by John K.Edwards et al. and assigned to Network Appliance, Inc. The underlyingphysical volume is an aggregate comprising one or more groups of disks,such as RAID groups, of the node. The aggregate has its own physicalvolume block number (pvbn) space and maintains meta-data, such as blockallocation structures, within that pvbn space. Each flexible volume hasits own virtual volume block number (vvbn) space and maintainsmeta-data, such as block allocation structures, within that vvbn space.Each flexible volume is a file system that is associated with acontainer file; the container file is a file in the aggregate thatcontains all blocks used by the flexible volume. Moreover, each flexiblevolume comprises data blocks and indirect blocks that contain blockpointers that point at either other indirect blocks or data blocks.

In one embodiment, pvbns are used as block pointers within buffer treesof files (such as file 700) stored in a flexible volume. This “hybrid”flexible volume embodiment involves the insertion of only the pvbn inthe parent indirect block (e.g., inode or indirect block). On a readpath of a logical volume, a “logical” volume (vol) info block has one ormore pointers that reference one or more fsinfo blocks, each of which,in turn, points to an mode file and its corresponding inode buffer tree.The read path on a flexible volume is generally the same, followingpvbns (instead of vvbns) to find appropriate locations of blocks; inthis context, the read path (and corresponding read performance) of aflexible volume is substantially similar to that of a physical volume.Translation from pvbn-to-disk, dbn occurs at the file system/RAID systemboundary of the storage operating system 300.

In an illustrative dual vbn hybrid flexible volume embodiment, both apvbn and its corresponding vvbn are inserted in the parent indirectblocks in the buffer tree of a file. That is, the pvbn and vvbn arestored as a pair for each block pointer in most buffer tree structuresthat have pointers to other blocks, e.g., level 1 (L1) indirect blocks,inode file level 0 (L0) blocks.

FIG. 8 is a schematic block diagram of an illustrative embodiment of abuffer tree of a file 800 that may be advantageously used with thepresent invention. A root (top-level) inode 802, such as an embeddedinode, references indirect (e.g., level 1) blocks 804. Note that theremay be additional levels of indirect blocks (e.g., level 2, level 3)depending upon the size of the file. The indirect blocks (and inode)contain pvbn/vvbn pointer pair structures 808 that ultimately referencedata blocks 806 used to store the actual data of the file.

The pvbns reference locations on disks of the aggregate, whereas thevvbns reference locations within files of the flexible volume. The useof pvbns as block pointers 808 in the indirect blocks 804 providesefficiencies in the read paths, while the use of vvbn block pointersprovides efficient access to required meta-data. That is, when freeing ablock of a file, the parent indirect block in the file contains readilyavailable vvbn block pointers, which avoids the latency associated withaccessing an owner map to perform pvbn-to-vvbn translations; yet, on theread path, the pvbn is available.

FIG. 9 is a schematic block diagram of an aggregate 900 in accordancewith an illustrative embodiment of the present invention. Luns (blocks)902, directories 904, qtrees 906 and files 908 may be contained withinflexible volumes 910, such as dual vbn flexible volumes, that, in turn,are contained within the aggregate 900. The aggregate 900 isillustratively layered on top of the RAID system, which is representedby at least one RAID plex 950 (depending upon whether the storageconfiguration is mirrored), wherein each plex 950 comprises at least oneRAID group 960. Each RAID group further comprises a plurality of disks930, e.g., one or more data (D) disks and at least one (P) parity disk.

Whereas the aggregate 900 is analogous to a physical volume of aconventional storage system, a flexible volume is analogous to a filewithin that physical volume. That is, the aggregate 900 may include oneor more files, wherein each file contains a flexible volume 910 andwherein the sum of the storage space consumed by the flexible volumes isphysically smaller than (or equal to) the size of the overall physicalvolume. The aggregate utilizes a physical pvbn space that defines astorage space of blocks provided by the disks of the physical volume,while each embedded flexible volume (within a file) utilizes a logicalvvbn space to organize those blocks, e.g., as files. Each vvbn space isan independent set of numbers that corresponds to locations within thefile, which locations are then translated to dbns on disks. Since theflexible volume 910 is also a logical volume, it has its own blockallocation structures (e.g., active, space and summary maps) in its vvbnspace.

A container file is a file in the aggregate that contains all blocksused by a flexible volume. The container file is an internal (to theaggregate) feature that supports a flexible volume; illustratively,there is one container file per flexible volume. Similar to a purelogical volume in a file approach, the container file is a hidden file(not accessible to a user) in the aggregate that holds every block inuse by the flexible volume. The aggregate includes an illustrativehidden meta-data root directory that contains subdirectories of flexiblevolumes:

-   -   WAFL/fsid/filesystem file, storage label file

Specifically, a physical file system (WAFL) directory includes asubdirectory for each flexible volume in the aggregate, with the name ofsubdirectory being a file system identifier (fsid) of the flexiblevolume. Each fsid subdirectory (flexible volume) contains at least twofiles, a file system file and a storage label file. The storage labelfile is illustratively a 4 kB file that contains meta-data similar tothat stored in a conventional RAID label. In other words, the storagelabel file is the analog of a RAID label and, as such, containsinformation about the state of the flexible volume such as, e.g., thename of the flexible volume, a universal unique identifier (uuid) andfsid of the flexible volume, whether it is online, being created orbeing destroyed, etc. For further details regarding the aggregate areprovided in U.S. patent application Ser. No. 11/119,278, entitledSTORAGE SYSTEM ARCHITECTURE FOR STRIPING DATA CONTAINER CONTENT ACROSSVOLUMES OF A CLUSTER, filed Apr. 29, 2005 by Michael Kazar et al., whichis incorporated herein by reference in its entirety.

FIG. 10 is a schematic block diagram of an on-disk representation of anaggregate 1000. The storage operating system 300, e.g., the RAID system380, assembles a physical volume of pvbns to create the aggregate 1000,with pvbns 1 and 2 comprising a “physical” volinfo block 1002 for theaggregate. The volinfo block 1002 contains block pointers to fsinfoblocks 1004, each of which may represent a snapshot of the aggregate.Each fsinfo block 1004 includes a block pointer to an inode file 1006that contains inodes of a plurality of files, including an owner map1010, an active map 1012, a summary map 1014 and a space map 1016, aswell as other special meta-data files. The inode file 1006 furtherincludes a root directory 1020 and a “hidden” meta-data root directory1030, the latter of which includes a namespace having files related to aflexible volume in which users cannot “see” the files. The hiddenmeta-data root directory includes the WAFL/fsid/directory structure thatcontains file system file 1040 and storage label file 1090. Note thatroot directory 1020 in the aggregate is empty; all files related to theaggregate are organized within the hidden meta-data root directory 1030.

In addition to being embodied as a container file having level 1 blocksorganized as a container map, the file system file 1040 includes blockpointers that reference various file systems embodied as flexiblevolumes 1050. The aggregate 1000 maintains these flexible volumes 1050at special reserved inode numbers. Each flexible volume 1050 also hasspecial reserved inode numbers within its flexible volume space that areused for, among other things, the block allocation bitmap structures. Asnoted, the block allocation bitmap structures, e.g., active map 1062,summary map 1064 and space map 1066, are located in each flexiblevolume.

Specifically, each flexible volume 1050 has the same inode filestructure/content as the aggregate, with the exception that there is noowner map and no WAFL/fsid/filesystem file, storage label file directorystructure in a hidden meta-data root directory 1080. To that end, eachflexible volume 1050 has a volinfo block 1052 that points to one or morefsinfo blocks 1054, each of which may represent a snapshot, along withthe active file system of the flexible volume. Each fsinfo block, inturn, points to an inode file 1060 that, as noted, has the same inodestructure/content as the aggregate with the exceptions noted above. Eachflexible volume 1050 has its own inode file 1060 and distinct inodespace with corresponding inode numbers, as well as its own root (fsid)directory 1070 and subdirectories of files that can be exportedseparately from other flexible volumes.

The storage label file 1090 contained within the hidden meta-data rootdirectory 1030 of the aggregate is a small file that functions as ananalog to a conventional raid label. A raid label includes physicalinformation about the storage system, such as the volume name; thatinformation is loaded into the storage label file 1090. Illustratively,the storage label file 1090 includes the name 1092 of the associatedflexible volume 1050, the online/offline status 1094 of the flexiblevolume, and other identity and state information 1096 of the associatedflexible volume (whether it is in the process of being created ordestroyed).

F. Mirroring Application

By way of further background, FIGS. 11A-11C illustrate a simplifiedversion of a flexible volume 1100 a in an illustrative mirroringenvironment in which the technique of the present invention can beadvantageously employed. To begin a mirroring session, a snapshot istaken of the entire active file system and is referred to as snapshot A.Illustratively, snapshot A includes block 1102 of a file. Subsequently,when a portion of the file is to be written to, the original block 1102containing that portion is not overwritten. Instead, in thewrite-anywhere file system of the illustrative embodiment of theinvention, a second block 1104 is created and stored as a new data blockin the flexible volume. In the example, a next snapshot of the flexiblevolume (now 1100 b) is taken and this next snapshot, snapshot B,includes the newly created block 1104. Further in accordance with theillustration of FIG. 11C, another block 1106 is created. Later, a newsnapshot is taken of the active file system 1100 c and this new snapshotC includes block 1106.

Assume further that the flexible volume is mirrored to destination X anddestination Y. FIGS. 11D and 11E are schematic illustrations of areplication of the volume of FIGS. 11A-11C being mirrored to a remotedestination. Further yet, assume that the volume 1100 a as it existed insnapshot A is mirrored to destination X and destination Y. Accordingly,each it is thus said that destination X has a reference snapshot ofsnapshot A and destination Y also has snapshot A as its referencesnapshot. At a later point in the replication process, the volume 1100 bis to be mirrored to destination X and destination Y. However, themirroring to destination X fails. Thus, destination X still has areference snapshot of snapshot A as shown in FIG. 11D, yet destination Yis at a reference snapshot of snapshot B, as shown in FIG. 11E.

Now, assume that the replication process is to be performed yet again,and the destinations X and Y are to receive an updated mirror of thevolume 1100 c from the primary server and the most current snapshot issnapshot C. However, it is noted that in the example, the destinationshave different reference snapshots. This can be better understood withreference to FIG. 12 which is a schematic illustration of a replicationof a volume being mirrored to a remote location subsequent to thereplication process of FIGS. 11D and 11E of the volume 1100 c in theenvironment of FIG. 11C. The volume is represented in the example of1100 c as containing snapshots A, B and C. In order to bring the mirrordestinations to the same state, all of the snapshots could be sent toeach destination, however, it would be more efficient to perform thereplication process incrementally such that only the new blocks are sentto the destinations. This means that destination X (which is atreference snapshot A) needs to receive any new blocks from snapshots Band C. Note that snapshot A is shown as dashed-line block 1202 becauseit already resides on destination X, while newly created blocksassociated with snapshots B and C are shown as solid-line blocks 1204and 1206, respectively; these newly-created blocks are thus sent todestination X in this round of replication. Destination Y, which alreadyhas snapshot A shown in dashed-line block 1210 and already has newblocks from snapshot B shown in dashed-line block 1212, only needs toreceive the newly created blocks from snapshot C, shown as solid-lineblock 1214.

In accordance with the present invention, such incremental mirroring canbe performed without repeatedly scanning the volume to determine whichblocks are to be sent to which destinations. To that end, it is notedthat each data block has a block “owner” such that the owner of theblock is the oldest snapshot which refers to it. Based upon this conceptof block ownership, the present invention assigns a logical age to eachsnapshot and thus to each block owned by that snapshot. Illustratively,the ages are assigned as follows:

Active file system=0

First snapshot=3

Next snapshot=2

Most recent snapshot=1

Only those blocks of a certain age are then sent to the respectivedestinations. More specifically, the mirroring application configures ascanner and sender to carry out the following policy:

If the block's assigned age is greater than or equal to thedestination's reference snapshot age, the block is filtered out and isnot sent; and/or

If the block's assigned age is less than the destination's referencesnapshot age, then the block is sent to the destination.

FIG. 13 is a schematic block diagram of a multiple destination mirroringenvironment 1300 in accordance with an illustrative embodiment of thepresent invention. D-module 350 is a primary server acting as a mirrorsource in the multiple destination mirroring environment 1300. TheD-module 350 includes a file system 360 that cooperates with mirroringapplication 366 to replicate the file system to the remote destinationsfor purposes of, e.g., back up, disaster recovery and load balancing.More specifically, the active file system 360 is mirrored to remotedestination X embodied as server 1302 that cooperates with a SVSdesignated by the disk 1303, destination Y embodied as server 1304 andSVS 1305, and destination Z embodied as server 1306 and SVS 1307.

As noted the file system 360 provides logical volume managementcapabilities for use in accessing information stored on storage devicesassociated with the D-module, such as for example, flexible volume 1308.The file system 360 also includes a snapshot manager 362 that managescreation of snapshots 364. The mirroring application 366 configures ascanner 1310 that also has access to the snapshots 364 that are to bemirrored to the destinations 1302, 1304, and 1306 under the direction ofthe mirroring application 366. Illustratively, the scanner 1310 isimplemented as a software object, which is executed by a thread in theillustrative ONTAP® environment. The scanner thread is created when anew mirror session starts, and the thread is destroyed when the sessionis finished. The scanner thread can instead be allocated from a threadpool when a mirror session is started, which is then returned to threadpool when the session finishes. It should be understood that, as withthe other modules and functions described herein, the scanner canalternatively be implemented in firmware or in hardware in otherapplications of the invention.

Illustratively, the mirroring application 366 configures the scanner1310 with the following items of configuration information: the volumeto be scanned (i.e. the source volume to be mirrored); the oldestreference snapshot among all the senders; the newly created snapshotwhich the mirror application creates for this mirror session (i.e., thelatest snapshot); and the queue into which the generated data is to beloaded. Each of these functions is described in further detail herein.Based upon this configuration information, the scanner performs thefollowing tasks: calculates the volume space to scan (i.e. vbn space);registers the snapshots of the volume between oldest reference snapshotand the latest snapshot; identifies the snapshots of the volume, andassigns the snapshot's logical age; and scans the snapshots in the orderof oldest snapshot registered first, toward the latest snapshot.

More specifically, and referring to FIG. 13, the scanner scans thevolume 1308 for newly created blocks. The scanner tags these blocks witha logical age, and places blocks into a queue 1312, which blocks arelater to be sent to the destination by way of a sender module that isassigned to each destination. For example, sender module 1322 isassigned to and transmits blocks to mirror destination X, sender module1324 is assigned to and transmits blocks to the mirror destination Y,and sender module 1326 is assigned to and transmits blocks to mirrordestination Z in the manner described herein.

When a mirroring session is started, the mirror application creates anew snapshot, and uses it as the latest snapshot to be mirrored to thedestination mirrors. For each mirror destination, the mirror applicationconstructs a sender module. Each sender module queries the destinationmirror module about its reference snapshot. If the destination mirrormodule reports it is a new destination that requires first timemirroring for this destination, the corresponding sender is recorded as“baseline” mirror. Otherwise, the sender for this destination recordsthe destination mirror's reference snapshot information. Notably, a“reference snapshot” is the latest (most recent) snapshot on thedestination mirror.

After mirroring the data to the destination successfully, the mirrordestination is updated to have the latest snapshot in the most recentmirroring as its reference snapshot. For example, assume that uponinitial configuration, snapshot A of the active file system stored onflexible volume 1308 is mirrored to destination X which then has areference snapshot of snapshot A. Assume also that destination Y isinstantiated subsequently and has a reference snapshot of snapshot B.

Illustratively, as file access requests are completed and data iswritten to the volume 1308, newly created blocks are added to thevolume. Thus, when a further replication process is to be performed,only the newly created blocks need to be sent to the mirror destinationsX and Y. When it is time to perform a replication, the mirrorapplication creates a new snapshot of the active file system in order tocapture the newly created blocks needed to be sent to the mirrordestinations of X and Y. Instead of sending the entire newest snapshotof the complete file system, illustratively only those blocks that havebeen newly created (files that have been edited) as of each mirrordestination's reference snapshot are sent to that mirror destination.

To that end, scanner 1310 of mirror source D-module is programmed toregister the latest snapshot created by the mirror application 366. Inaddition, the scanner 1310 also is programmed to register the oldestreference snapshots of all the destination mirrors in the group asrepresented by the senders. In addition, it further registers all thesnapshots between the above two snapshots, namely all of the snapshotsthat have occurred between the oldest reference snapshot and the newsnapshot just taken for the mirroring process. If any of the destinationmirrors are new to the system and thus need to have a transfer inbaseline mode, the scanner will register all those snapshots that werecreated before the newly created latest snapshot. The scanner thencalculates a logical age associated with each such snapshot, with thenewly created latest snapshot being assigned an age equal to one.

Each sender will be tagged using the age of its own reference snapshotas well. If the destination mirror of the sender needs baseline modemirroring because it has no data, it is assigned an age that is theoldest possible value in the system so that any blocks in the volumewill have an age at least younger than that. This ensures the newdestination mirror will receive all the blocks that the scannerproduces.

The scanner then scans the flexible volume to search for newly createdblocks. In order to identify newly created blocks, the scanner 1310further inspects the block allocation structures for the flexiblevolume. This can be performed in a number of different ways.Illustratively, the scanner 1310 loads the inode of the snapshot'sactive bitmap 1012 (FIG. 10) file for that flexible volume. The blocknumber (fbn) is calculated within the active bitmap file 1012 for theblock using its vbn. After locating which bitmap block should containthe block's allocation information, the bitmap block is loaded into anassociated buffer 1311 located within the scanner 1310. The contents arethen examined to determine whether the corresponding bit is set or not.If the block's corresponding bit is set, then it is known that the blockis allocated in the snapshot, otherwise, it is known that the block isnot allocated in that snapshot. The scanner 1310 examines the snapshot'sactive bitmap in the order of from oldest snapshot toward the morerecent snapshots which are registered with the scanner. Once a snapshotis taken, a particular block in question is allocated in the activebitmap 1012 of that snapshot. Thus, as soon as a snapshot it reachedthat has that bit allocated for the particular block, it is known thatthis snapshot is the oldest owner of that block.

The scanner 1310 then assigns an age to that block corresponding to theblock ownership as determined in the manner just described. The oldestsnapshot in the set will have the highest number, working down to themost recent snapshot which, in accordance with an embodiment of theinvention, is assigned the number 1. Thus, the scanner 1310 tags eachblock with a logical age in accordance with this paradigm.

If the block's age is the same as the oldest reference snapshotregistered with scanner, the block is discarded by the scanner, becauseall the destinations should already have this block. For blocks whoseage is younger than the oldest reference snapshot, the scanner 1310 thenloads tagged blocks into queue 1312 where they are stored fortransmission to each destination as required. In the illustrativeexample, blocks belonging to the original baseline snapshot age areassigned an age of 3, i.e., the relative age of snapshot A. Blocks whichare owned by the next snapshot B, for example, are assigned an age of 2,i.e., the relative age of snapshot B. Further, newer blocks which areeven younger than those owned by snapshot B belong to snapshot C and areassigned an age of 1, as snapshot C in the example is the most recentsnapshot and as such is assigned an age of 1.

During a mirror operation, sender X 1322, for example, queriesdestination X to determine its reference snapshot. Sender 1322 savesthat information in its own local memory, as illustrated by the block1332. Similarly, the sender Y 1324 queries its destination 1304 andstores its reference snapshot as illustrated by the block 1334.

Assume for example that destination X has a reference snapshot ofsnapshot A, and destination Y has a reference snapshot of snapshot B.The destination Z 1306 is later added to the multiple destination mirrorenvironment. In a replication process, snapshot C is created. Scanner1310 is configured to search for the following snapshots: the latestsnapshot C, and snapshot A and snapshot B, because destination Z needsbaseline mirror for the first time mirroring.

Sender X is aware that destination X has not received snapshot B orsnapshot C and thus sends blocks subsequent to reference snapshot A todestination X in order to update destination X with current changes.When sender Y performs its replication process, it has been notifiedthat destination Y has a reference of snapshot B. Thus, destination Yalready has blocks owned by snapshot B, so it only requires blocks ownedby snapshot C in order to be current. Sender Z is aware that it is inbaseline mirroring mode, thus it needs all the blocks in snapshot A, B,C to send to the destination.

In order to hasten this determination, the age of the block as tagged bythe scanner is checked by the sender. Sender X is tagged by itsreference snapshot A's age. Sender Y is tagged by its reference snapshotB's age. Sender Z has special age value, which is the oldest agepossible in the system. In response to examining such a tagged blockfrom the queue, the sender performs the following calculation: if ablock's assigned age is greater than or equal to the sender's referencesnapshot age, the block is filtered out and is not sent; else, if ablock's assigned age is less than the sender's reference snapshot age,then that block is sent to the destination. In this way, the volume isscanned once and the generated blocks are filtered by individual sendersbefore sending them to the corresponding destination based on therelative age assigned by the scanner.

FIG. 14 is a flowchart illustrating a procedure for initialconfiguration of the multiple destination mirroring environment when amirroring session is to commence. The procedure starts at step 1402 andcontinues to step 1404 where initial configuration of the environmentincludes taking a snapshot of the active file system at the primaryserver, and this snapshot is thus the latest snapshot in this mirroringsession. In step 1406, for each mirror destination, a sender module iscreated, and each sender module queries its destination mirror moduleabout its reference snapshot. In step 1408, upon receiving thedestination's reference snapshot information, the reference snapshotsare then registered with the scanner; the scanner determines which ofthe reference snapshots is the oldest and then calculates the logicalage of each snapshot based upon the snapshot's freshness with respect tothe active file system, with the latest snapshot having an age of 1. Itis noted that if there is a new destination that is undergoing a firsttime mirroring (such as for example, Destination Z in FIG. 13), thatdestination does not have a reference snapshot but instead is inbaseline mirroring mode. In that case, the scanner is instructed to scanfrom the oldest snapshot in the volume.

In step 1410, each sender is tagged with a logical age based upon itsreference snapshot (see FIG. 13). If the sender has no referencesnapshot because it is in first time baseline mirroring, that sender istagged with the oldest possible value in the system. The process ends atstep 1412 and the system waits until the next replication process is tooccur.

FIG. 15 is a flowchart illustrating a procedure for replication ofupdated data to each destination in the multiple destination mirrorenvironment of the present invention. The procedure begins at the startstep, 1502 and proceeds to step 1504 in which the scanner scans theflexible volume to be mirrored to the destinations for blocks whoseowner is newer than the oldest reference snapshot in the group. In step1506, the scanner tags each such newer block with a logical age that isequivalent to the oldest snapshot that owns that block. (As noted withreference to FIG. 14, the scanner has already calculated the age of eachsnapshot with the most recent snapshot being assigned an age of one, andwith progressively older snapshots assigned 2, 3, etc.). In step 1508,the scanner 1310 loads the tagged blocks in the queue 1312.

In step 1510, each sender inspects block in the queue and filters thoseblocks whose age is older than or equal to the sender's referencesnapshot age, which means that the sender filters out blocks that thedestination already has. The sender sends those blocks tagged with anage that is more recent than the reference snapshot. In step 1512, onsuccessfully mirroring to the destination, the destination referencesnapshot is updated to the latest snapshot in the mirroring process,such that the next time mirroring takes place, the sender will use thenew reference snapshot to do the filtering. The procedure ends at step1514.

It should be understood that this process requires only one pass of thescanner through a flexible volume and does not require the scanner torepeatedly scan the volume for each destination as it is updated. Inthis way, as noted, the volume is scanned only once and blocks arefiltered by individual senders before sending them to the destinationbased on their relative ages assigned by the scanner. This aspect of theinvention greatly reduces the I/O operations at the source volume whenthe source active file system is mirrored to multiple destinations, andcan be used even when the destinations have different referencesnapshots. The novel technique also does not require explicit dataversion support on the block level. This technique can further be usedin volume copy and volume move operations to determine the differencebetween two file systems in replication.

The foregoing description has been directed to particular embodiments ofthis invention. It will be apparent however, that other variations andmodifications may be made to the described embodiments, with theattainment of some or all of their advantages. Specifically, it shouldbe noted that the principles of the present invention may be implementedin non-distributed file systems. Furthermore, while this description hasbeen written in terms of N and D-modules, the teachings of the presentinvention are equally suitable to systems where the functionality of theN and D-modules are implemented in a single system. Alternately, thefunctions of the N and D-modules may be distributed among any number ofseparate systems, wherein each system performs one or more of thefunctions. Additionally, the procedures, processes and/or modulesdescribed herein may be implemented in hardware, software, embodied as acomputer-storage medium having program instructions, firmware, or acombination thereof. Therefore, it is the object of the appended claimsto cover all such variations and modifications as come within the truespirit and scope of the invention.

1. A system for mirroring an active file system of a primary server toone or more destinations in a distributed storage system environment,the system comprising: a volume of the primary server, the volume havingone or more data blocks; a snapshot manager running on the primaryserver configured to create one or more snapshots of the active filesystem, with each data block in a snapshot being owned by the oldestsnapshot in which it appeared; and a mirroring application running onthe primary server, said mirroring application configuring a sendermodule associated with each destination, said sender module configuredto query its destination for information about a reference snapshot forthat destination, and said mirroring application also configuring ascanner to register each snapshot of which it is notified by each senderand to find the oldest snapshot in a group of destinations in a mirrorprocess, and assigning a logical age to each snapshot, said scannerbeing further configured to scan said volume to inspect its data blocks,and to select data blocks that are newer than the oldest referencesnapshot in the group and to tag those blocks with a logical agecorresponding with the age of the snapshot that owns that data block. 2.The system as defined in claim 1 further comprising: a queue associatedwith said scanner, said queue storing data blocks tagged by saidscanner; and said sender modules being further configured to inspectdata blocks in said queue and to filter blocks older than an assignedlogical age and to select data blocks from said queue of a predeterminedlogical age and to send those blocks to its associated destinationserver to configure said destination server as a mirror of the primaryserver.
 3. The system as defined in claim 1 wherein said scanner is asoftware object that is executed by a thread in an operating system inthe primary server.
 4. The system as defined in claim 1 furthercomprising: a cluster fabric protocol for application program interfacecommunications between said snapshot manager and said mirroringapplication, and between said mirroring application and said scanner andsaid senders.
 5. The system as defined in claim 4 wherein said clusterfabric protocol also includes messaging protocols for communicationbetween said senders and said destination servers.
 6. A method ofmirroring data in a distributed storage system having an active filesystem to multiple destinations, the method including the steps of:creating a snapshot of the active file system being the latest snapshotin a mirroring session; for each mirror destination, configuring asender module, said sender module querying its destination about itsreference snapshot; on receiving its destination reference snapshotinformation, registering at said sender module the reference snapshotwith a scanner; calculating at said scanner, the reference snapshot'slogical age based upon its freshness with respect to the active filesystem, and determining the oldest snapshot in a group of destinationsin the mirroring session being established; and tagging each snapshotwith a logical age, with the latest snapshot in the mirror session asage
 1. 7. The method as defined in claim 6 including the further stepsof: mirroring data to the destinations including: scanning a flexiblevolume for data blocks whose snapshot owner's age is newer than saidoldest reference snapshot in the group of destinations in the mirroringsession; and tagging such blocks with a logical age related to thesnapshot owner of that block.
 8. The method as defined in claim 7including the further step of loading tagged data blocks in a queue. 9.The method as defined in claim 8 including the further steps of:inspecting at sender module said blocks in said queue; filtering datablocks in said queue that are of a logical age that is older than orequal to the destination server's reference snapshot; and selecting datablocks from said queue that are of a logical age that is less than thedestination server's reference snapshot, and sending said data blocks tosaid destination server.
 10. The method as defined in claim 7 furthercomprising the step of identifying a new destination that requiresbaseline mirroring and assigning the new destination a predefined valuethat is older than the oldest snapshot in the volume.
 11. The method asdefined in claim 7 wherein said volume is scanned a single time toselect blocks of said predetermined age.
 12. A computer storage mediumfor mirroring data in a distributed storage system having multipledestinations, comprising program instructions for performing the stepsof: creating a snapshot of the active file system being the latestsnapshot in a mirroring session; for each mirror destination,configuring a sender module, said sender module querying its destinationabout its reference snapshot; on receiving its destination referencesnapshot information, registering at said sender module the referencesnapshot with a scanner; calculating at said scanner, the referencesnapshot's logical age based upon its freshness with respect to theactive file system, and determining the oldest snapshot in a group ofdestinations in the mirroring session being established; and taggingeach snapshot with a logical age, with the latest snapshot in the mirrorsession as age
 1. 13. The computer readable medium as defined in claim12 comprising further program instructions for performing the steps of:mirroring data to the destinations including: scanning a flexible volumefor data blocks whose snapshot owner's age is newer than said oldestreference snapshot in the group of destinations in the mirroringsession; and tagging such blocks with a logical age related to thesnapshot owner of that block.
 14. The computer readable medium asdefined in claim 13 comprising further program instructions forperforming the steps of: loading tagged data blocks in a queue;inspecting at sender module said blocks in said queue; filtering datablocks in said queue that are of a logical age that is older than orequal to the destination server's reference snapshot; and selecting datablocks from said queue that are of a logical age that is less than thedestination server's reference snapshot, and sending said data blocks tosaid destination server.
 15. The computer readable medium as defined inclaim 12 comprising further program instructions for performing thesteps of identifying a new destination that requires baseline mirroringand assigning the new destination a predefined value that is older thanthe oldest snapshot in the volume.
 16. The computer readable medium asdefined in claim 12 comprising further program instructions forperforming the step of scanning said volume a single time to inspect andtag said data blocks.
 17. A system for mirroring an active file systemof a primary server to one or more destinations in a distributed storagesystem environment, the system comprising: means for creating a snapshotof the active file system being the latest snapshot in a mirroringsession; means, at each mirror destination, for configuring a sendermodule, said sender module querying its destination about its referencesnapshot; means for, at each sender on receiving its destinationreference snapshot information, registering at said sender module thereference snapshot with a scanner; means for calculating at saidscanner, the reference snapshot's logical age based upon its freshnesswith respect to the active file system, and determining the oldestsnapshot in a group of destinations in the mirroring session beingestablished; and means for tagging each snapshot with a logical age,with the latest snapshot in the mirror session as age
 1. 18. The systemas defined in claim 17 further comprising: means for storing tagged datablocks in a queue; means for configuring a sender module to beassociated with each destination server for querying the associateddestination server to determine a reference snapshot for thatdestination server; means for filtering at said sender module datablocks in said queue that are of a logical age that is greater than orequal to the destination server's reference snapshot; and means forselecting by said sender module data blocks from said queue that are ofa logical age that is less than the destination server's referencesnapshot, and sending said data blocks to said destination server. 19.The system as defined in claim 17 further comprising means foridentifying a new destination that requires baseline mirroring andassigning the new destination a predefined value that is older than theoldest snapshot in the volume.
 20. The system as defined in claim 17further comprising means for scanning said volume a single time toinspect and tag said data blocks.
 21. The system as defined in claim 17further comprising means for sending messages in accordance with acluster fabric protocol between said primary server and said sendermodules.
 22. The system as defined in claim 17 further comprising meansfor sending messages in accordance with a cluster fabric protocolbetween each said sender module and its associated destination server.23. A method of assigning an age to a data block with reference to agiven snapshot, comprising the steps of: loading at a scanner an inodeof the given snapshot's active bitmap file for a flexible volume;calculating a block number within the active bitmap file of the datablock using its volume block number; locating a bitmap block thatcontains the block's allocation information; loading the bitmap blockinto an associated buffer; examining the bitmap block's contents todetermine whether a corresponding bit for the data block is set or notand if the data block's corresponding bit is set, then the block isallocated in the snapshot, if not, the block is not allocated in thatsnapshot; and assigning an age to the data block corresponding to theage of the first snapshot in which the block is allocated.